Comments (5)
How would they be stored in the db?
from storext.
As a hash or array of hashes.
For example:
{
address_attributes: {
name: "Joe"
address1: "123 Main St"
city: "Ann Arbor"
state: "MI"
postal_code: "12345-6789"
}
}
Would basically be instantiated using:
class Address
include ActiveModel::Model
attr_accessor :name, :address1, :etc
end
from storext.
Cool. Happy to accept PRs!
from storext.
As a hash or array of hashes.
For example:
{ address_attributes: { name: "Joe" address1: "123 Main St" city: "Ann Arbor" state: "MI" postal_code: "12345-6789" } }Would basically be instantiated using:
class Address include ActiveModel::Model attr_accessor :name, :address1, :etc end
How do you use it? is there a code somewhere I can see it in action?
from storext.
Just cleaning up -- closing this.
Reading it again, yes I second @maysam's question. Let's see a valid use-case before merging it in. In the scenario you posted, I would've just made another Address
model.
from storext.
Related Issues (20)
- Default value based on another value? HOT 2
- `hash': wrong number of arguments (given 1, expected 0) (ArgumentError)
- Replace 'Virtus' with 'dry-types' for Coercion HOT 5
- Encrypt stored data HOT 4
- Any support for responding to Enums? HOT 2
- Use with Ransack HOT 2
- Update single attribute in hash column HOT 4
- Support namespace HOT 3
- Can't dump anonymous class if default value not set. HOT 9
- Boolean type not recognized when using store_attributes inside concern HOT 4
- Empty string is converted to nil automatically HOT 3
- 3.0.0 File permissions issue HOT 3
- define conditional attributes HOT 2
- Rails 6.0.0 Support HOT 1
- How do I manage validatations of attributes with Storext? HOT 2
- Audited gem HOT 2
- Support for Rails 6.1 HOT 3
- Using Github Actions instead of Travis?
- Rails 7 support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storext.