Hi Rick,
Thanks for reply. Could use of the old version cause this problem?
Actually I wanted to use the latest version of Rails but that was not
compatible with the ruby installed in my system and I could not figure
out which Ruby version was compatible with latest Rails at that time
(2.3.4).
I my code the instance variable @plat refers to platforms, similarly the
variable @rel refers to release. So actually I have folders in my
application that is applicable for some releases and platforms. After
selecting these platforms and releases a Javascript is called which
stores the combination of release and platforms and stored in another
dropdown menu with name platrel with platform name nd release name
separated by a hyphen ("-") so in controller you will only see the
variable platrel. I am pasting the controller code below.
Contrller code:
params[:platrel]['id'].each {|x|
pr = ""
pr = x.split("\-")
platid = Platform.find(:first,:conditions => ['name =
?',pr[0].to_s]).id
relid = Release.find(:first,:conditions => ['release_name =
?',pr[1].to_s]).id
@newAvail = Ownership.find(:first, :conditions => ['folder_id =
? and platform_id = ? and release_id = ? and stop IS NULL and deleted
IS NULL', params[:f],platid,relid])
if @newAvail.blank?
@ownerships = Ownership.new(
:folder_id => params[:f],
:platform_id => platid,
:release_id => relid,
:primary_owner => @fold_owner.primary_owner,
:secondary_owner => @fold_owner.secondary_owner,
:created => Time.new,
:start => Time.new )
@ownerships.save
if (pr[0].to_s != "Any")
anyid = Platform.find(:first,:conditions =>
['name = "Any"']).id
@anyAvail = Ownership.find(:first, :conditions
=> ['folder_id = ? and platform_id = ? and release_id = ? and stop IS
NULL and deleted IS NULL', params[:f],anyid,relid])
if @anyAvail.blank?
@any_ownerships = Ownership.new(
:folder_id => params[:f],
:platform_id => anyid,
:release_id => relid,
:primary_owner =>
@fold_owner.primary_owner,
:secondary_owner =>
@fold_owner.secondary_owner,
:created => Time.new,
:start => Time.new )
@any_ownerships.save
end
end
else
@newAvail.stop = 'NULL'
@newAvail.deleted = 'NULL'
Thanks,
Nitin.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.