adelevie/parse_resource

get_attribute and set_attribute

davidhq opened this issue · 8 comments

I just wanted to ask if get_attribute and set_attribute are supported (they're listed in the docs), but I get:
undefined method `set_attribute' for #Spot:0x007fd04451ef70

Also when I create a method for some field, like

def address=(val)
  #something
end

it doesn't seem to get executed at all :s

Thank you!

Are you inheriting from ParseResource::Base?

class Spot < ParseResource::Base
  # stuff
end

Yes, I am:

class Spot < ParseResource::Base

Hmm?

On 8. apr. 2013, at 19:15, Jamon Holmgren notifications@github.com wrote:

Are you inheriting from ParseResource::Base?

class Spot < ParseResource::Base

stuff

end

Reply to this email directly or view it on GitHub.

Those should be working.

https://github.com/clearsightstudio/parse_resource/blob/master/lib/parse_resource/base.rb#L26

The ActiveModel::AttributeMethods module (I think) has those methods defined, so it should work.

Any other info you can provide that might help narrow it down?

Hmm just thought about this:

Is the right version installed by default via rubygems?

I'm still not at home so cannot check on my iphone :)

David

On 9. apr. 2013, at 18:27, Jamon Holmgren notifications@github.com wrote:

Those should be working.

https://github.com/clearsightstudio/parse_resource/blob/master/lib/parse_resource/base.rb#L26

The ActiveModel::AttributeMethods module (I think) has those methods defined, so it should work.

Any other info you can provide that might help narrow it down?


Reply to this email directly or view it on GitHub.

That may be the issue. If you want to use the ClearSight version you'll need to do this in your Gemfile:

gem 'parse_resource', :git => 'git://github.com/clearsightstudio/parse_resource.git'

So I found out what the issue was…

the default version that gets installed with "gem install parse_resource"
doesn't have get and set_attribute defined…

Both ClearSight and adelevie have and it works!

I think that's a bit confusing… Is it possible that you would set one of
these two versions as the default rubygems version? Related: what are
mostly the differences between ClearSight and adelevie versions? Are both
actively maintained and merged one into another?

thank you!
david

On Tue, Apr 9, 2013 at 7:22 PM, Jamon Holmgren notifications@github.comwrote:

That may be the issue. If you want to use the ClearSight version you'll
need to do this in your Gemfile:

gem 'parse_resource', :git => 'git://
github.com/clearsightstudio/parse_resource.git'


Reply to this email directly or view it on GitHubhttps://github.com//issues/67#issuecomment-16127040
.

I have one more open and somewhat related question…

I have this:

def state_text=(val)
@state_text = val
end

in my model.. and the corresponding input field on the form

the problem is that this method doesn't get executed (the value assigned)
at all.. I would need this and don't know why is this behaviour and how to
get around it… Thank you!

david

On Thu, Apr 11, 2013 at 5:15 PM, David Krmpotic david.krmpotic@gmail.comwrote:

So I found out what the issue was…

the default version that gets installed with "gem install parse_resource"
doesn't have get and set_attribute defined…

Both ClearSight and adelevie have and it works!

I think that's a bit confusing… Is it possible that you would set one of
these two versions as the default rubygems version? Related: what are
mostly the differences between ClearSight and adelevie versions? Are both
actively maintained and merged one into another?

thank you!
david

On Tue, Apr 9, 2013 at 7:22 PM, Jamon Holmgren notifications@github.comwrote:

That may be the issue. If you want to use the ClearSight version you'll
need to do this in your Gemfile:

gem 'parse_resource', :git => 'git://
github.com/clearsightstudio/parse_resource.git'


Reply to this email directly or view it on GitHubhttps://github.com//issues/67#issuecomment-16127040
.

Is it possible that you would set one of these two versions as the default rubygems version?

@adelevie -- does it make sense to push another build to RubyGems?

what are mostly the differences between ClearSight and adelevie versions? Are both actively maintained and merged one into another?

Essentially, @adelevie's version is the "authoritative" version. ClearSight developed our own fork for our own needs because we had a very tight timeframe and needed several new features for our app. We're slowly merging our fork back into Alan's and eventually they'll be synced (although we may keep a branch open for our legacy app if the API isn't exactly the same).

This means that there are several parts on ClearSight's fork that work better, such as dates.