Questions tagged [active-attr]

ActiveAttr is a set of modules that makes it easy to create plain old ruby models with functionality found in ORMs, like ActiveRecord, without reinventing the wheel. Think of ActiveAttr as the stuff ActiveModel left out.

ActiveAttr is a set of modules that makes it easy to create plain old models with functionality found in ORMs, like ActiveRecord, without reinventing the wheel. Think of ActiveAttr as the stuff left out.

References:

12 questions
5
votes
2 answers

Scrubbing a block from a call to super

I'm working with ActiveAttr which gives you that nice initialize via block option: person = Person.new() do |p| p.first_name = 'test' p.last_name = 'man' end However, in a specific class that include ActiveAttr::Model, I want to bypass this…
TheDelChop
  • 7,938
  • 4
  • 48
  • 70
3
votes
2 answers

TypeError: #<...> is not a symbol

I cannot figure out this issue, even if it does not seem complicated... I want to make a form to send emails in my rails app but this one does not work. I receive the following error: TypeError in MessagesController#create: #
lgerard
  • 117
  • 1
  • 2
  • 10
2
votes
1 answer

How to translate attributes of table-less model?

RailsCast #326 ActiveAttr explains how to create table-less models. How can one translate the attributes as it is explained for table-based attributes in the rails docs?
user569825
  • 2,369
  • 1
  • 25
  • 45
1
vote
1 answer

Difference between attribute and attr_accessor in ActiveAttr gem?

I'm trying to use the active_attr gem to create models backed by a NoSQL database that doesn't seem to have any other ORMs or mappers that fit our needs. In the documentation (https://github.com/cgriego/active_attr), it shows examples defining…
1
vote
0 answers

Accessing ActiveRecord entries from ActiveAttr

I have an ActiveAttr model and I want to do a lookup on certain data using ActiveRecord class Api::V1::Salesubmit include ActiveAttr::Model include ActiveModel::Validations::Callbacks attribute :secret . . . validate…
Lasse Laursen
  • 131
  • 1
  • 8
1
vote
1 answer

Custom Typecaster with ActiveAttr Rails Gem

I would like to create a custom Typecaster for the ActiveAttr Gem. I have a Package class: class Package include ActiveAttr::Model attribute :quantity, :type => Integer attribute :detail attribute :type attribute :order def shipping …
danilodeveloper
  • 3,840
  • 2
  • 36
  • 56
0
votes
1 answer

Rails ActiveAttr Gem, manipulation of attributes within Class?

I have a Rails 5 class which includes ActiveAttr::Model, ActiveAttr:MassAssignment and ActiveAttr::AttributeDefaults. It defines a couple of attributes using the method attribute and has some instance methods. I have some trouble manipulating the…
MDickten
  • 105
  • 1
  • 10
0
votes
1 answer

Tableless ActiveRecord Object with few persistant data?

I want tableless AR object. Pseudo code: # tablefull AR object class Item < ActiveRecord::Base has_one :color end # tableless AR object, but persistant class Color include ActiveAttr::Model belongs_to :item attribute :color Colors =…
0
votes
2 answers

ActiveAttr stops working on production server

I have created a simple model for handling a contact form: class ContactForm include ActiveAttr::Model attribute :name attribute :email attribute :message attr_accessible :name, :email, :message validates_presence_of :name, :email,…
AlexBrand
  • 11,971
  • 20
  • 87
  • 132
0
votes
2 answers

Error with simple_form and active_attr

I am using active_attr and simple_form. When I navigate to the page that should show my form I get the following error: undefined method `new_record?' for # Here is my model: class Message …
Arjan
  • 6,264
  • 2
  • 26
  • 42
0
votes
2 answers

Ruby On Rails - Not sending email in development mode

similar problem Rails contact form not working guides: https://github.com/thomasklemm/email_form_rails rails 3.2.x app\models\message.rb class Message include ActiveAttr::Model include ActiveModel::Validations attribute :name attribute…
rails_id
  • 8,120
  • 4
  • 46
  • 84
-1
votes
1 answer

React router NavLink active attribute instead of activeClassName

Is there any way to set active state in active attribute instead of activeClassName on React Router NavLink? For a specific reason, it needs to be in the active state. There is this isActive function in NavLink that I think might be useful to…
Ela Yudhanira
  • 66
  • 1
  • 10